﻿<Controls1:ChromeWindow x:Class="AvalonDockControls.Views.AvalonDockShell" x:Name="m_Window"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:cal="http://www.codeplex.com/CompositeWPF"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Globals1="clr-namespace:WpfRcp.Core.Globals;assembly=WpfRcp.Core"           
             xmlns:Controls1="clr-namespace:WpfRcp.Controls;assembly=WpfRcp.Controls"
             xmlns:Windows1="clr-namespace:AvalonDockControls.Views" Height="600"
             Width="800" MinHeight="400" MinWidth="700"
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
             ChromeWindowStyle="NoChrome" WindowStyle="SingleBorderWindow" ResizeMode="CanResize" BorderThickness="0"
             WindowStartupLocation="CenterScreen" Background="{DynamicResource MainWindowBackground}" Focusable="True"
             Style="{StaticResource DefaultChromeWindowStyleKey}" Margin="0" Icon="{Binding RcpSettings.WindowIcon}"
             Title="{Binding RcpSettings.TaskBarAppName}">

    <Window.Resources>
        <Storyboard x:Key="Intro">
            <DoubleAnimation Storyboard.TargetName="m_LeftToolBarPanel" Storyboard.TargetProperty="RenderTransform.X"
                             From="-200" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_HeaderPanel" Storyboard.TargetProperty="RenderTransform.Y"
                             From="-200" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_RightPanelTabControl" Storyboard.TargetProperty="RenderTransform.X"
                             From="550" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_StatusBar" Storyboard.TargetProperty="RenderTransform.Y"
                             From="100" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_VisualizationTabControl" Storyboard.TargetProperty="Opacity"
                             From="0" To="1" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0.5" />

        </Storyboard>

        <Storyboard x:Key="HeaderGone">

            <ThicknessAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Margin"
                                To="0,-32,0,0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <DoubleAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Opacity"
                             From="1" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ThicknessAnimation Storyboard.TargetName="m_MainPanel" Storyboard.TargetProperty="Margin"
                                To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0:0:1.5" Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>

        </Storyboard>

        <Storyboard x:Key="HeaderAppeared">

            <ThicknessAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Margin"
                                    To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <DoubleAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Opacity"
                                 From="0" To="1" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ThicknessAnimation Storyboard.TargetName="m_MainPanel" Storyboard.TargetProperty="Margin"
                                    To="20" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>

        </Storyboard>

    </Window.Resources>

    <DockPanel x:Name="m_MainPanel" Margin="20">

        <DockPanel.LayoutTransform>
            <ScaleTransform CenterX="0"
                            CenterY="0"
                            ScaleX="{Binding Path=Settings.WorkspaceScale}"
                            ScaleY="{Binding Path=Settings.WorkspaceScale}" />
        </DockPanel.LayoutTransform>

        <!--HEADER AND MENU-->
        <StackPanel x:Name="m_HeaderPanel" DockPanel.Dock="Top">
            <StackPanel.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </StackPanel.RenderTransform>

            <!--HEADER-->
            <Grid x:Name="m_Header" Margin="0,0,0,0" Visibility="Visible">
                <Grid.RenderTransform>
                    <TranslateTransform X="0" Y="0" />
                </Grid.RenderTransform>

                <StackPanel Orientation="Horizontal">
                    <TextBlock FontFamily="Segoe" FontSize="36" FontStretch="Normal" FontWeight="Light"
                            TextWrapping="Wrap" Margin="-2,-15.14,0,0"
                            Foreground="{DynamicResource MammothHeader1Foreground}"
                            Text="{Binding RcpSettings.AppName}" />
                    <TextBlock FontFamily="Segoe" FontSize="36" FontStretch="Normal" FontWeight="Light"
                            TextWrapping="Wrap" Margin="5,-15.14,0,0"
                            Foreground="{DynamicResource MammothHeader2Foreground}"
                            Text="{Binding RcpSettings.AppNameExtended}" />
                </StackPanel>
            </Grid>

            <!--TOP MENU-->
            
        </StackPanel>

        <StatusBar Height="22" Margin="0,5,0,0" DockPanel.Dock="Bottom" Name="m_StatusBar">
            <StatusBar.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </StatusBar.RenderTransform>

            <StatusBarItem>
                <TextBlock Text="{Binding RcpSettings.StatusMessageLeft}"></TextBlock>
            </StatusBarItem>

            <StatusBarItem HorizontalAlignment="Right">
                <TextBlock Text="{Binding RcpSettings.StatusMessageRight}"></TextBlock>
            </StatusBarItem>
        </StatusBar>

        <!--LEFT TOOL BAR-->
        <ItemsControl x:Name="m_LeftToolBarPanel" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.ToolbarRegion}" DockPanel.Dock="Left">
            <ItemsControl.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </ItemsControl.RenderTransform>
        </ItemsControl>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MinHeight="{x:Static Windows1:AvalonDockShell.VisualizationMenuMinHeight}" />
                <RowDefinition x:Name="m_SplitterRow" Height="{x:Static Windows1:AvalonDockShell.SplitterSize}" />
                <RowDefinition x:Name="m_BottomTabMenuRow"
                               Height="{x:Static Windows1:AvalonDockShell.BottomMenuDefaultHeight}"
                               MinHeight="{x:Static Windows1:AvalonDockShell.BottomMenuMinHeight}"/>
            </Grid.RowDefinitions>

            <ad:DockingManager x:Name="dockManager" Grid.Row="0"  Background="{DynamicResource ExpanderTabControlBackground}" BorderBrush="{DynamicResource TabItemBackground}" Foreground="{DynamicResource TabItemForeground}">
                    <ad:ResizingPanel Orientation="Horizontal">
                    <ad:DocumentPane x:Name="m_VisualizationTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.DocumentRegion}" MinWidth="{x:Static Windows1:AvalonDockShell.VisualizationMenuMinWidth}"
                                     Background="{DynamicResource ExpanderTabControlBackground}" Margin="3,0,0,0">
                    </ad:DocumentPane>
                    <ad:DockablePane ad:ResizingPanel.ResizeWidth="{x:Static Windows1:AvalonDockShell.RightMenuDefaultWidth}" MinWidth="{x:Static Windows1:AvalonDockShell.RightMenuMinWidth}" x:Name="m_RightPanelTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.SidePanelRegion}" 
                                     ShowHeader="False" Background="{DynamicResource ExpanderTabControlBackground}">
                        <ad:DockablePane.RenderTransform>
                            <TranslateTransform X="0" Y="0" />
                        </ad:DockablePane.RenderTransform>
                    </ad:DockablePane>
                    </ad:ResizingPanel>
            </ad:DockingManager>

            <!--ROW 2-->
            <GridSplitter x:Name="m_VerticalGridSplitter" Focusable="False" Grid.Row="1" Grid.Column="0" Height="Auto" Width="Auto" Opacity="0.0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />

            <!--ROW 3-->
            <Controls1:TabMenu x:Name="m_BottomPanelTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.BottomRegion}" Grid.Row="2" Grid.Column="0" Margin="3,0,0,0" VisibilityChanged="OnBottomTabMenuVisibilityChanged">
            </Controls1:TabMenu>

        </Grid>
    </DockPanel>
</Controls1:ChromeWindow>
